#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        for (int cur = 0, dest = -1; cur < nums.size(); cur++)
            if (nums[cur])
                swap(nums[++dest], nums[cur]);
    }
};
int main()
{
    vector<int> v;
    int array[] = { 0,0,3,4,5,6,0 };
    int sz = sizeof(array) / sizeof(array[0]);
    for (int i = 0; i < sz; i++)
        v.push_back(array[i]);
    Solution().moveZeroes(v);
    for (int i = 0; i < v.size(); i++)
    {
        cout << v[i] << " ";
    }
    cout << endl;
	return 0;
}
/*
题目链接:https://leetcode.cn/problems/move-zeroes/description/
*/
